Optimal. Leaf size=113 \[ \frac {b^2 \cos \left (2 a-\frac {2 b c}{d}\right ) \text {Ci}\left (\frac {2 b c}{d}+2 b x\right )}{d^3}-\frac {b \cos (a+b x) \sin (a+b x)}{d^2 (c+d x)}-\frac {\sin ^2(a+b x)}{2 d (c+d x)^2}-\frac {b^2 \sin \left (2 a-\frac {2 b c}{d}\right ) \text {Si}\left (\frac {2 b c}{d}+2 b x\right )}{d^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 113, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {3395, 31, 3393,
3384, 3380, 3383} \begin {gather*} \frac {b^2 \cos \left (2 a-\frac {2 b c}{d}\right ) \text {CosIntegral}\left (\frac {2 b c}{d}+2 b x\right )}{d^3}-\frac {b^2 \sin \left (2 a-\frac {2 b c}{d}\right ) \text {Si}\left (\frac {2 b c}{d}+2 b x\right )}{d^3}-\frac {b \sin (a+b x) \cos (a+b x)}{d^2 (c+d x)}-\frac {\sin ^2(a+b x)}{2 d (c+d x)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 3380
Rule 3383
Rule 3384
Rule 3393
Rule 3395
Rubi steps
\begin {align*} \int \frac {\sin ^2(a+b x)}{(c+d x)^3} \, dx &=-\frac {b \cos (a+b x) \sin (a+b x)}{d^2 (c+d x)}-\frac {\sin ^2(a+b x)}{2 d (c+d x)^2}+\frac {b^2 \int \frac {1}{c+d x} \, dx}{d^2}-\frac {\left (2 b^2\right ) \int \frac {\sin ^2(a+b x)}{c+d x} \, dx}{d^2}\\ &=\frac {b^2 \log (c+d x)}{d^3}-\frac {b \cos (a+b x) \sin (a+b x)}{d^2 (c+d x)}-\frac {\sin ^2(a+b x)}{2 d (c+d x)^2}-\frac {\left (2 b^2\right ) \int \left (\frac {1}{2 (c+d x)}-\frac {\cos (2 a+2 b x)}{2 (c+d x)}\right ) \, dx}{d^2}\\ &=-\frac {b \cos (a+b x) \sin (a+b x)}{d^2 (c+d x)}-\frac {\sin ^2(a+b x)}{2 d (c+d x)^2}+\frac {b^2 \int \frac {\cos (2 a+2 b x)}{c+d x} \, dx}{d^2}\\ &=-\frac {b \cos (a+b x) \sin (a+b x)}{d^2 (c+d x)}-\frac {\sin ^2(a+b x)}{2 d (c+d x)^2}+\frac {\left (b^2 \cos \left (2 a-\frac {2 b c}{d}\right )\right ) \int \frac {\cos \left (\frac {2 b c}{d}+2 b x\right )}{c+d x} \, dx}{d^2}-\frac {\left (b^2 \sin \left (2 a-\frac {2 b c}{d}\right )\right ) \int \frac {\sin \left (\frac {2 b c}{d}+2 b x\right )}{c+d x} \, dx}{d^2}\\ &=\frac {b^2 \cos \left (2 a-\frac {2 b c}{d}\right ) \text {Ci}\left (\frac {2 b c}{d}+2 b x\right )}{d^3}-\frac {b \cos (a+b x) \sin (a+b x)}{d^2 (c+d x)}-\frac {\sin ^2(a+b x)}{2 d (c+d x)^2}-\frac {b^2 \sin \left (2 a-\frac {2 b c}{d}\right ) \text {Si}\left (\frac {2 b c}{d}+2 b x\right )}{d^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.78, size = 101, normalized size = 0.89 \begin {gather*} -\frac {-2 b^2 \cos \left (2 a-\frac {2 b c}{d}\right ) \text {Ci}\left (\frac {2 b (c+d x)}{d}\right )+\frac {d \left (d \sin ^2(a+b x)+b (c+d x) \sin (2 (a+b x))\right )}{(c+d x)^2}+2 b^2 \sin \left (2 a-\frac {2 b c}{d}\right ) \text {Si}\left (\frac {2 b (c+d x)}{d}\right )}{2 d^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 193, normalized size = 1.71
method | result | size |
derivativedivides | \(\frac {-\frac {b^{3}}{4 \left (-d a +c b +d \left (b x +a \right )\right )^{2} d}-\frac {b^{3} \left (-\frac {\cos \left (2 b x +2 a \right )}{\left (-d a +c b +d \left (b x +a \right )\right )^{2} d}-\frac {-\frac {2 \sin \left (2 b x +2 a \right )}{\left (-d a +c b +d \left (b x +a \right )\right ) d}+\frac {-\frac {4 \sinIntegral \left (-2 b x -2 a -\frac {2 \left (-d a +c b \right )}{d}\right ) \sin \left (\frac {-2 d a +2 c b}{d}\right )}{d}+\frac {4 \cosineIntegral \left (2 b x +2 a +\frac {-2 d a +2 c b}{d}\right ) \cos \left (\frac {-2 d a +2 c b}{d}\right )}{d}}{d}}{d}\right )}{4}}{b}\) | \(193\) |
default | \(\frac {-\frac {b^{3}}{4 \left (-d a +c b +d \left (b x +a \right )\right )^{2} d}-\frac {b^{3} \left (-\frac {\cos \left (2 b x +2 a \right )}{\left (-d a +c b +d \left (b x +a \right )\right )^{2} d}-\frac {-\frac {2 \sin \left (2 b x +2 a \right )}{\left (-d a +c b +d \left (b x +a \right )\right ) d}+\frac {-\frac {4 \sinIntegral \left (-2 b x -2 a -\frac {2 \left (-d a +c b \right )}{d}\right ) \sin \left (\frac {-2 d a +2 c b}{d}\right )}{d}+\frac {4 \cosineIntegral \left (2 b x +2 a +\frac {-2 d a +2 c b}{d}\right ) \cos \left (\frac {-2 d a +2 c b}{d}\right )}{d}}{d}}{d}\right )}{4}}{b}\) | \(193\) |
risch | \(-\frac {b^{2} {\mathrm e}^{-\frac {2 i \left (d a -c b \right )}{d}} \expIntegral \left (1, 2 i b x +2 i a -\frac {2 i \left (d a -c b \right )}{d}\right )}{2 d^{3}}-\frac {b^{2} {\mathrm e}^{\frac {2 i \left (d a -c b \right )}{d}} \expIntegral \left (1, -2 i b x -2 i a -\frac {2 \left (-i a d +i b c \right )}{d}\right )}{2 d^{3}}-\frac {1}{4 d \left (d x +c \right )^{2}}-\frac {\left (-2 b^{2} d^{3} x^{2}-4 b^{2} c \,d^{2} x -2 b^{2} c^{2} d \right ) \cos \left (2 b x +2 a \right )}{8 d^{2} \left (d^{2} x^{2} b^{2}+2 b^{2} c d x +b^{2} c^{2}\right ) \left (d x +c \right )^{2}}+\frac {i \left (4 i b^{3} d^{3} x^{3}+12 i b^{3} c \,d^{2} x^{2}+12 i b^{3} c^{2} d x +4 i b^{3} c^{3}\right ) \sin \left (2 b x +2 a \right )}{8 d^{2} \left (d^{2} x^{2} b^{2}+2 b^{2} c d x +b^{2} c^{2}\right ) \left (d x +c \right )^{2}}\) | \(290\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains complex when optimal does not.
time = 0.41, size = 206, normalized size = 1.82 \begin {gather*} \frac {b^{3} {\left (E_{3}\left (\frac {2 \, {\left (-i \, b c - i \, {\left (b x + a\right )} d + i \, a d\right )}}{d}\right ) + E_{3}\left (-\frac {2 \, {\left (-i \, b c - i \, {\left (b x + a\right )} d + i \, a d\right )}}{d}\right )\right )} \cos \left (-\frac {2 \, {\left (b c - a d\right )}}{d}\right ) + b^{3} {\left (i \, E_{3}\left (\frac {2 \, {\left (-i \, b c - i \, {\left (b x + a\right )} d + i \, a d\right )}}{d}\right ) - i \, E_{3}\left (-\frac {2 \, {\left (-i \, b c - i \, {\left (b x + a\right )} d + i \, a d\right )}}{d}\right )\right )} \sin \left (-\frac {2 \, {\left (b c - a d\right )}}{d}\right ) - b^{3}}{4 \, {\left (b^{2} c^{2} d - 2 \, a b c d^{2} + {\left (b x + a\right )}^{2} d^{3} + a^{2} d^{3} + 2 \, {\left (b c d^{2} - a d^{3}\right )} {\left (b x + a\right )}\right )} b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 223 vs.
\(2 (111) = 222\).
time = 0.50, size = 223, normalized size = 1.97 \begin {gather*} \frac {d^{2} \cos \left (b x + a\right )^{2} - 2 \, {\left (b d^{2} x + b c d\right )} \cos \left (b x + a\right ) \sin \left (b x + a\right ) - 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \sin \left (-\frac {2 \, {\left (b c - a d\right )}}{d}\right ) \operatorname {Si}\left (\frac {2 \, {\left (b d x + b c\right )}}{d}\right ) - d^{2} + {\left ({\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \operatorname {Ci}\left (\frac {2 \, {\left (b d x + b c\right )}}{d}\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \operatorname {Ci}\left (-\frac {2 \, {\left (b d x + b c\right )}}{d}\right )\right )} \cos \left (-\frac {2 \, {\left (b c - a d\right )}}{d}\right )}{2 \, {\left (d^{5} x^{2} + 2 \, c d^{4} x + c^{2} d^{3}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sin ^{2}{\left (a + b x \right )}}{\left (c + d x\right )^{3}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 3.29, size = 5141, normalized size = 45.50 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\sin \left (a+b\,x\right )}^2}{{\left (c+d\,x\right )}^3} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________